﻿// ***********************************************************************
// Project			: Micua
// Assembly         : Micua.Model
// Author           : iceStone
// Created          : 2013-11-23 15:22
//
// Last Modified By : iceStone
// Last Modified On : 2013-11-23 15:27
// ***********************************************************************
// <copyright file="DbContext.cs" company="Wedn.Net">
//     Copyright (c) Wedn.Net. All rights reserved.
// </copyright>
// <summary>数据库上下文</summary>
// ***********************************************************************

using System.Data.Entity;

namespace Micua.Model.CodeFirst
{
    /// <summary>
    /// 数据库上下文.
    /// </summary>
    /// <remarks>
    ///  2013-11-23 15:28 Created By iceStone
    /// </remarks>
    public class MContext : DbContext
    {
        /// <summary>
        /// 
        /// </summary>
        public MContext()
            : base("Data Source=(local);Initial Catalog=EFTest;User ID=sa;Password=wanglei")
        {

        }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Types().Configure(entity => entity.ToTable("Shop_" + entity.ClrType.Name));
        }
        public DbSet<Post> Posts { get; set; }
    }
}